package com.zretc.support.tool;

import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 根据前端需要的格式进行了适当的调整
 *
 * @param <T>
 */
@Component
public class PageData<T> {

	private List<T> records;// 存储的分页的数据 ,等价于我们刚刚查询的list
	private int current;// 当前页
	private int total;// 总记录数
	private int size;// 每页的记录数
	private int code;
	private String msg;
	
	public PageData() {
		super();
	}

	public PageData(List<T> records, int current, int total, int size, int code, String msg) {
		this.records = records;
		this.current = current;
		this.total = total;
		this.size = size;
		this.code = code;
		this.msg = msg;
	}

	public List<T> getRecords() {
		return records;
	}

	public void setRecords(List<T> records) {
		this.records = records;
	}

	public int getCurrent() {
		return current;
	}

	public void setCurrent(int current) {
		this.current = current;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
}